package com.naihe.anderson.sms.entity;

import java.io.Serializable;

public class Nhsms implements Serializable, Comparable<Nhsms> {

	public Nhsms(){
		_id = 0;
		thread_id = 0;
		address = "";
		person = 0;
		date = 0;
		date_sent = 0;
		protocol = 0;
		read = 0;
		status = 0;
		type = 0;
		reply_path_present = 0;
		subject = "";
		body = "";
		service_center = "";
		locked = 0;
		error_code = 0;
		seen = 0;
	}
	/**
	 * 短消息序号
	 */
	public static final String _ID = "_id";

	/**
	 * 对话的序号（conversation）
	 */
	public static final String THREAD_ID = "thread_id";

	/**
	 * 发件人地址，手机号
	 */
	public static final String ADDRESS = "address";

	/**
	 * 发件人，返回一个数字就是联系人列表里的序号，陌生人为null
	 */
	public static final String PERSON = "person";

	/**
	 * 日期 long型，想得到具体日期自己转换吧！
	 */
	public static final String DATE = "date";

	/**
	 * 
	 */
	public static final String DATE_SENT = "date_sent";

	/**
	 * 协议标识符代码,0 SMS_RPOTO, 1 MMS_PROTO
	 */
	public static final String PROTOCOL = "protocol";

	/**
	 * 是否阅读
	 */
	public static final String READ = "read";

	/**
	 * 状态
	 */
	public static final String STATUS = "status";
	public static final int STATUS_NONE = -1;
	public static final int STATUS_COMPLETE = 0;
	public static final int STATUS_PENDING = 64;
	public static final int STATUS_FAILED = 128;

	/**
	 * 类型
	 */
	public static final String TYPE = "type";
	public static final int MESSAGE_TYPE_ALL = 0;
	public static final int MESSAGE_TYPE_INBOX = 1;//收件箱
	public static final int MESSAGE_TYPE_SENT = 2;//发件箱
	public static final int MESSAGE_TYPE_DRAFT = 3;	//草稿箱
	
	public static final int MESSAGE_TYPE_OUTBOX = 4;	//wait for send
	public static final int MESSAGE_TYPE_FAILED = 5; // for failed outgoing
														// messages
	public static final int MESSAGE_TYPE_QUEUED = 6; // for messages to send
														// later

	/**
	 * 
	 */
	public static final String REPLY_PATH_PRESENT = "reply_path_present";

	/**
	 * 主题
	 */
	public static final String SUBJECT = "subject";

	/**
	 * 短消息内容
	 */
	public static final String BODY = "body";

	/**
	 * 短信服务中心号码编号，可以得知该短信是从哪里发过来的
	 */
	public static final String SERVICE_CENTER = "service_center";

	/**
	 * 
	 */
	public static final String LOCKED = "locked";

	/**
	 * 
	 */
	public static final String ERROR_CODE = "error_code";

	/**
	 * 
	 */
	public static final String SEEN = "seen";

	/**
	 * 
	 */
	private static final long serialVersionUID = 8676137391590383359L;

	/**
	 * 所有的短信
	 */
	public static final String SMS_URI_ALL = "content://sms/";
	/**
	 * 收件箱短信
	 */
	public static final String SMS_URI_INBOX = "content://sms/inbox";
	/**
	 * 发件箱短信
	 */
	public static final String SMS_URI_SEND = "content://sms/sent";
	/**
	 * 草稿箱短信
	 */
	public static final String SMS_URI_DRAFT = "content://sms/draft";

	
	private long _id;
	private long thread_id;
	private String address;
	private long person;
	private long date;
	private long date_sent;
	private int protocol;
	private int read;
	private int status;
	private int type;
	private int reply_path_present;
	private String subject;
	private String body;
	private String service_center;
	private int locked;
	private int error_code;
	private int seen;

	public long get_id() {
		return _id;
	}

	public void set_id(long _id) {
		this._id = _id;
	}

	public long getThread_id() {
		return thread_id;
	}

	public void setThread_id(long thread_id) {
		this.thread_id = thread_id;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public long getPerson() {
		return person;
	}

	public void setPerson(long person) {
		this.person = person;
	}

	public long getDate() {
		return date;
	}

	public void setDate(long date) {
		this.date = date;
	}

	public long getDate_sent() {
		return date_sent;
	}

	public void setDate_sent(long date_sent) {
		this.date_sent = date_sent;
	}

	public int getProtocol() {
		return protocol;
	}

	public void setProtocol(int protocol) {
		this.protocol = protocol;
	}

	public int getRead() {
		return read;
	}

	public void setRead(int read) {
		this.read = read;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public int getReply_path_present() {
		return reply_path_present;
	}

	public void setReply_path_present(int reply_path_present) {
		this.reply_path_present = reply_path_present;
	}

	public String getSubject() {
		return subject;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}

	public String getBody() {
		return body;
	}

	public void setBody(String body) {
		this.body = body;
	}

	public String getService_center() {
		return service_center;
	}

	public void setService_center(String service_center) {
		this.service_center = service_center;
	}

	public int getLocked() {
		return locked;
	}

	public void setLocked(int locked) {
		this.locked = locked;
	}

	public int getError_code() {
		return error_code;
	}

	public void setError_code(int error_code) {
		this.error_code = error_code;
	}

	public int getSeen() {
		return seen;
	}

	public void setSeen(int seen) {
		this.seen = seen;
	}
	
	@Override
	public int compareTo(Nhsms another) {
		if(another.getDate() > getDate())
			return -1;
		else
			return 1;
	}

	@Override
	public String toString() {
		
		return "_id=" + _id + " || address=" + address + " || body=" + body + " || service_center=" + service_center;
	}
}
